<section id="thankyou">
    <div class="container">
        <div class="row">   
            <div class="col-lg-12">         
                <div id="Bread">
                    <ol class="breadcrumb">
                        <li><a href="<?php echo SITE_URL; ?>">Home</a></li>
                        <li class="active">Teach</li>
                    </ol>
                </div><!--bread-->
            </div>
        </div>


        <div class="clearfix"></div>
        <div class="gap"></div>
        <div class="row clearfix">                
            <div class="col-lg-8 teach-text clearfix">
                <h1>Teach</h1>
                <div class="gap"></div>
                <p>Create your trainer profile with our easy-to-signup up process, and add well-detailed workshops (one day sessions) or courses (multi-sessions). Share your class structure, add photos and videos from your classes to add depth, and connect with interested participants. Get started right now!</p>
            </div>
            <div class="col-lg-4"></div>
        </div>
        <div class="gap"></div>
        <div class="clearfix"></div>
        <div class="col-lg-8 col-sm-8 col-md-8">
        <?php
        $userId = getLoginUserId();
        if (!empty($userId)) {
            ?>
            <a class="style-de-button" href="javascript:void(0)"  onclick="checkProfile('classes/create');">Create a Workshop </a>
             <a class="style-de-button" href="javascript:void(0)"  onclick="checkProfile('courses/create');">Create a Course</a>
             <a class="style-de-button" href="<?php echo $this->createAbsoluteUrl('/myskillhippo'); ?>" class="btn addmarginB10">My SkillHippo</a>
            <div id="techloader" style="display:none;" align="center">&nbsp;<img src="<?php echo ThemePath(); ?>/images/myskill.gif" align="absmiddle"></div>
            <div id="formResult" class="errorMessage"></div>                       
        <?php } else { ?>
            <a class="style-de-button" style="margin:0 !important;" href="<?php echo $this->createAbsoluteUrl('/users/trainer'); ?>">Create a Profile</a><?php } ?>
        </div>
        <div class="gap"></div>

    </div>  


    <div class="gap"></div>
    <div class="gap"></div>
    <div class="gap1"></div>
</div><!-- Main Container Class -->

</section>



<?php
$allClassCourseInfo = array();
$classDetails = getAllliteralEndingTommorowWorkshop('', '', '',LITERAL_ENDING_RENDER_PAGE_LIMIT);
$courseDetails = getAllliteralEndingTommorowCourses('', '', '',LITERAL_ENDING_RENDER_PAGE_LIMIT); //Null parameter means these value $profiles, $userType, $getValue)
$allClassCourseInfo = array_merge($classDetails, $courseDetails);
usort($allClassCourseInfo, 'date_compare');
if (!empty($allClassCourseInfo)) {
    $this->renderPartial('/classes/literallyEndingtomorrow', array('allClassCourseInfo' => $allClassCourseInfo));
}
?>
<script>
    function checkProfile(action) {
        jQuery.ajax({
            'type': 'POST',
            'url': "<?php echo Yii::app()->createAbsoluteUrl("users/checkProfile"); ?>",
            'data': 'YII_CSRF_TOKEN=' + $('input[name="YII_CSRF_TOKEN"]').val() + '&action=' + action,
            'beforeSend': function(jqXHR, settings) {
                $("#techloader").show();
            },
            'success': function(data) {
                $("#AjaxLoader").hide();
                if (data == 1) {
                    $("#formResult").text("First complete your profile.");
                    window.setTimeout(function() {
                        $("#techloader").show();
                        window.location.href = '<?php echo Yii::app()->createAbsoluteUrl("/myskillhippo"); ?>';
                    }, 5000);
                }
                else {
                    window.location.href = data;
                }
            },
            'cache': false
        });
    }
</script>